"""
URL configuration for card_game project.
"""
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
from . import views

urlpatterns = [
    path('admin/', admin.site.urls),
    
    # 页面路由
    path('', views.home, name='home'),
    path('lobby/', views.game_lobby, name='game-lobby'),
    path('cards/', views.card_collection, name='card-collection'),
    path('decks/', views.deck_builder, name='deck-builder'),
    path('game/<int:game_id>/', views.game_room, name='game-room'),
    
    # API路由
    path('api/auth/', include('apps.accounts.urls')),
    path('api/cards/', include('apps.cards.urls')),
    path('api/decks/', include('apps.decks.urls')),
    path('api/games/', include('apps.games.urls')),
    path('api/matchmaking/', include('apps.matchmaking.urls')),
]

# Serve media files in development
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
